package com.woniuxy.carlife.mapper;

import com.woniuxy.carlife.domain.ServiceAppraiseTag;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.woniuxy.carlife.dto.AppraiseTagDto;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author fx
 * @ClassName:ServiceAppraiseTagMapper
 * @Description: 门店服务评价标签mapper接口
 * @date 2021/4/6 20:00
 **/

public interface ServiceAppraiseTagMapper extends BaseMapper<ServiceAppraiseTag> {

    /**
     * 功能描述〈根据门店id查询评论标签的内容和标签被选择的数量〉
     * @author:fx
     * @param: @param null:
     * @return:
     * @Date 2021/4/10 14:15
     * @throws
     */
    @Select("SELECT  " +
            " comment_tag_content, " +
            " comment_tag_num " +
            "FROM t_service_appraise_tag " +
            "WHERE store_id=#{storeId}")
    List<AppraiseTagDto> findContenAndNumByStoreId(Integer storeId);

    /**
     * 功能描述〈根据门店id查询指定门店评论标签状态为已使用的标签并获得标签id〉
     * @author:fx
     * @param: @param null:
     * @return: 返回标签内容和被选择的数量
     * @Date 2021/4/10 15:40
     * @throws
     */
    @Select("SELECT  " +
            " comment_tag_id, " +
            " comment_tag_content, " +
            " comment_tag_num " +
            "FROM t_service_appraise_tag " +
            "WHERE store_id=#{storeId}" +
            " AND comment_tag_status=1 ")
    List<AppraiseTagDto> findContenAndNumByStoreIdAndStatus(Integer storeId);
}
